package com.suliao.home.serviceImpl.industry;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.suliao.home.entity.industry.CompanyExhibitorInformationVO;
import com.suliao.home.entity.industry.ExhibitorDO;
import com.suliao.home.mapper.industry.CompanyExhibitorInformationMapper;
import com.suliao.home.mapper.industry.ExhibitorMapper;
import com.suliao.home.service.industry.CompanyExhibitorInformationService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Auther: miaowenbin
 * @Date: 2020-12-24 13:30
 * @description :
 * @version: 1.0
 */
@Service
public class CompanyExhibitorInformationServiceImpl extends ServiceImpl<CompanyExhibitorInformationMapper, CompanyExhibitorInformationVO> implements CompanyExhibitorInformationService {

    @Autowired
    private CompanyExhibitorInformationMapper companyExhibitorInformationMapper;

    @Autowired
    private ExhibitorMapper exhibitorMapper;
    /**
     * 查询公司展商信息
     * @param page
     * @param areaCode
     * @param customClassName
     * @param corpIdentities
     * @param corpBusinessModel
     * @param productTitle
     * @param topicName
     * @param industryName
     * @param infoType
     * @return
     */
    @Override
    public Page<CompanyExhibitorInformationVO> exhibitorCompany(Page page, String areaCode, String customClassName, String corpIdentities, String corpBusinessModel, String productTitle, String topicName, String industryName,String infoType) {
        ExhibitorDO exhibitorDO=new ExhibitorDO();
        selectExhibiorCount(exhibitorDO);
        Page<CompanyExhibitorInformationVO> pageInfo=companyExhibitorInformationMapper.exhibitorCompany(page,areaCode,customClassName,corpIdentities,corpBusinessModel,productTitle,topicName,industryName,infoType);
        return pageInfo;
    }

    /**
     * 展品信息
     * @param page
     * @param areaCode
     * @param customClassName
     * @param corpIdentities
     * @param corpBusinessModel
     * @param productTitle
     * @param topicName
     * @param industryName
     * @param infoType
     * @return
     */
    @Override
    public Page<CompanyExhibitorInformationVO> pageIndustryProduct(Page page, String areaCode, String customClassName, String corpIdentities, String corpBusinessModel, String productTitle, String topicName, String industryName, String infoType) {
        Page<CompanyExhibitorInformationVO> pageInfo=companyExhibitorInformationMapper.pageIndustryProduct(page,areaCode,customClassName,corpIdentities,corpBusinessModel,productTitle,topicName,industryName,infoType);
        return pageInfo;
    }


    /**
     * 查询并且修改展商下的展品总量
     */
    public int selectExhibiorCount(ExhibitorDO industryExhibitor) {
        return exhibitorMapper.selectExhibiorCount(industryExhibitor);
    }
}
